<template>
	<view class="text-white">
		<view class="ceiling" :style="{ 'padding-top': statusBarHeight + 'px' }"></view>
		<uni-nav-bar style="font-weight: 600;" left-icon="back" title="文章详情" right-icon="more-filled" backgroundColor="#EE515A" color="#ffffff" @clickLeft="gotoback"></uni-nav-bar>
		<view class="content bg_FFFFFF">
			<text class="text-black text-xxl text-bold">{{title}}</text>
			<!-- <view class="margin-top-sm color_A8AFC2">{{atime}}</view> -->
			<view class="text" style="color: #333333;padding: 30rpx 0;text-align: justify;">
				<u-parse :html="article"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	import searchHead from "@/component/searchHead/searchHead.vue"
	export default {
		components: {
			searchHead
		},	
		data() {
			return {
				statusBarHeight: getApp().globalData.statusBarHeight, //状态栏高度
				article: '',
				id: 0,
				title: '',
				atime:''
			};
		},
		methods: {
			
			getArcticle: function() {
				this.$Request.post(this.$api.index.getArcticle, {
					id: this.id
				}).then(res => {
					this.article = res.data.details;
					this.title = res.data.title;
					this.atime = res.data.atime
				})
			},
			getNotices: function() {
				this.$Request.post(this.$api.index.getNotices, {
					id: this.id
				}).then(res => {					
					this.article = res.data.details;
					this.title = res.data.title;
					this.atime = res.data.atime
				})
			},
			gotoback() {
				uni.navigateBack({
					delta: 1
				})
			},
		},
		onLoad: function(e) {
			this.id = e.id;
			if(e.type == 1){
				this.getNotices()
			}else{
				this.getArcticle()
			}
		},
	}
</script>
<style>
	page{
		background-color: #FFFFFF;
	}
</style>
<style lang="scss" scoped>
	@import "./detail.scss";

	.content .text {
		color: #FFFFFF;
	}
</style>
